<template>
    <div class="cl6">
        <div class="main">
            <div class="item">
                <img src="@/assets/DownParticle@2x.png" alt="">
                <p>{{ mainData[0] }}</p>
                <span>月度晾晒</span>
            </div>
            <div class="border"></div>
            <div class="item">
                <img src="@/assets/DownParticle@2x.png" alt="">
                <p>{{ mainData[1] }}</p>
                <span>季度比拼</span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ['infoData', 'posItem', 'yearItem'],
    data() {
        return {
            mainData: []
        }
    },
    watch: {
        posItem: function (infoData) {
            this.mainDataInit();
        },
        yearItem: function (infoData) {
            this.mainDataInit();
        },
    },
    mounted() {
        this.mainDataInit();
    },
    methods: {
        mainDataInit() {
            this.mainData = [];
            this.infoData[16].map((i, o) => {
                if (i[0] == this.posItem) {
                    this.mainData = i[this.yearItem].split(',')
                }
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.cl6 {
    width: 520px;
    height: 180px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 520px;
        height: 180px;
        z-index: 1;
        background-image: url('../../assets/denglukuang.png');
        background-repeat: no-repeat;
        background-size: 100% 100%;
        opacity: .4;
    }

    .main {
        position: relative;
        width: 520px;
        height: 180px;
        z-index: 2;
        color: #fff;
        background: radial-gradient(circle, #2b4c85cc 30%, #23365700);
        display: flex;
        justify-content: space-around;
        align-items: center;

        .item {
            width: 140px;
            height: 140px;
            position: relative;
            margin-top: -20px;

            span {
                position: absolute;
                z-index: 1;
                bottom: 15px;
                left: 5px;
                width: 100%;
                text-align: center;
                display: inline-block;
                font-family: 'YSBTH';
                font-size: 28px;
                text-shadow: 0 0 8px #000;
                letter-spacing: 5px;
                position: relative;
                z-index: 3;
            }

            img {
                width: 160px;
                position: absolute;
                z-index: 1;
                bottom: 0;
                animation: imgAnimate 2s linear infinite alternate;
            }


            p {
                font-family: 'YSBTH';
                font-size: 80px;
                width: 100%;
                text-shadow: 0 0 32px rgb(0, 143, 0);
                text-align: center;
                margin-top: 20px;
                position: relative;
                z-index: 3;
            }
        }

        .item:last-of-type {
            p {
                text-shadow: 0 0 32px #f00;

            }
        }

        .border {
            height: 130px;
            width: 1px;
            background-color: #ffffff11;
            box-shadow: 0 0 30px #fff;
        }
    }


}

@keyframes imgAnimate {
    0% {
        transform: scale(1, 1);
    }

    100% {
        transform: scale(1.2, 1.2);
    }
}
</style>